package com.exchange.websocket.common.huobi.impl;


import com.exchange.websocket.common.huobi.WebSocketService;
import com.exchange.websocket.common.utils.redis.RedisUtil;
import com.google.gson.Gson;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

/**
 * 订阅信息处理类需要实现WebSocketService接口
 *
 * @author okcoin
 */

public class FcoinBuissnesWebSocketServiceImpl implements WebSocketService {
    public static final Logger log = LoggerFactory.getLogger(FcoinBuissnesWebSocketServiceImpl.class);
    @Override
    public void onReceive(String msg, RedisUtil redisUtil) {
        log.info("FcoinWebSocket Client received message: " + msg);
        //string转map
        Gson gson = new Gson();
        Map<String,String> map = new HashMap<>();
        map = gson.fromJson(msg,map.getClass());
        log.info("map =={}",map);
    }
}
